package com.atguigu.my.chapter03

/**
 *
 * @description: xxx
 * @time: 2020-05-22 16:45
 * @author: baojinlong 
 **/
object FunctionDemo01 {
  def main(args: Array[String]): Unit = {
    var result = 1L
    "Hello".foreach(myFunction)
    print("计算结果为" + result)
    result = 1L
    "Hello".foreach(result *= _.toLong)
    print("计算结果为" + result)

    def myFunction(char: Char): Unit = {
      result *= char.toLong
    }
  }

  class MyTest {

  }

}
